<!--<div></div>-->
<form class="login-form" nz-form [formGroup]="form" (ngSubmit)="submit()" role="form">

  <div class="bby-logo-wrapper">
    <div class="bby-logo">
        <span class="logo-bby">
          <img src="assets/img/logo.png" alt="Logo"/>
        </span>
      <span class="logo-text">bby共享云</span>
    </div>
  </div>
  <nz-tabset [nzAnimated]="false" class="tabs" (nzSelectChange)="switch($event)">
    <nz-tab [nzTitle]="'账户密码登录'">
      <nz-alert *ngIf="error" [nzType]="'error'" [nzMessage]="error" [nzShowIcon]="true" class="mb-lg"></nz-alert>
      <nz-form-item>
        <nz-form-control nzErrorTip="请输入邮箱或者用户名">
          <nz-input-group nzSize="large" nzPrefixIcon="user">
            <input nz-input formControlName="account" placeholder="请输入邮箱或者用户名" />
          </nz-input-group>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-control nzErrorTip="Please enter password, muse be: ng-alain.com">
          <nz-input-group nzSize="large" nzPrefixIcon="lock">
            <input nz-input type="password" formControlName="password" placeholder="请输入密码" />
          </nz-input-group>
        </nz-form-control>
      </nz-form-item>
    </nz-tab>
    <nz-tab [nzTitle]="'邮箱登录'">
      <nz-form-item>
        <nz-form-control [nzErrorTip]="mailErrorTip">
          <nz-input-group nzSize="large" nzPrefixIcon="mail">
            <input nz-input formControlName="mail" placeholder="邮箱" />
          </nz-input-group>
          <ng-template #mailErrorTip let-i>
            <ng-container *ngIf="i.errors?.required">
              请输入邮箱！
            </ng-container>
            <ng-container *ngIf="i.errors?.pattern">
              邮箱格式错误！
            </ng-container>
          </ng-template>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-control [nzErrorTip]="'请输入验证码！'">
          <nz-row [nzGutter]="8">
            <nz-col [nzSpan]="16">
              <nz-input-group nzSize="large" nzPrefixIcon="message">
                <input nz-input formControlName="captcha" placeholder="邮箱验证码" />
              </nz-input-group>
            </nz-col>
            <nz-col [nzSpan]="8">
              <button type="button" nz-button nzSize="large" (click)="getCaptcha()" [disabled]="count >= 0" nzBlock [nzLoading]="loading">
                {{ count ? count + 's' : ('获取验证码') }}
              </button>
            </nz-col>
          </nz-row>
        </nz-form-control>
      </nz-form-item>
    </nz-tab>
  </nz-tabset>
  <nz-form-item>
    <nz-col [nzSpan]="12">
      <label nz-checkbox formControlName="remember">保持登录状态</label>
    </nz-col>
    <nz-col [nzSpan]="12" class="text-right">
      <a class="forgot" routerLink="/passport/register">忘记密码</a>
    </nz-col>
  </nz-form-item>
  <nz-form-item>
    <button nz-button type="submit" nzType="primary" nzSize="large" [nzLoading]="loading" nzBlock>
      登录
    </button>
  </nz-form-item>
</form>
<div class="other">
<!--  其他登录方式-->
<!--  <i nz-tooltip nzTooltipTitle="in fact Auth0 via window"  nz-icon nzType="alipay-circle" class="icon"></i>-->
<!--  <i nz-tooltip nzTooltipTitle="in fact Github via redirect" nz-icon nzType="taobao-circle" class="icon"></i>-->
<!--  <i nz-icon nzType="weibo-circle" class="icon"></i>-->
  <a class="register" routerLink="/user/register">注册账户</a>
</div>
